DATA606 Data Project

Abstract

It may be self-evident that the amount of money spent on education by a country will have an impact on the country’s literacy rate. But is there a statistically significant relationship? And can that relationship be quantified using a predictive model? It is further presumed that literacy rates will be lower in poorer regions of the world and in those having forms of government in which the head of state holds more power and has less accountability to his or her constituents. This project sought to validate those assumptions and to generate a model that will predict the change in literacy rate based on the studied parameters.

The study confirms that literacy rate is impacted positively by educational spending, with a fairly steep relationship: A one-percent increase in educational spending yields an almost a three-percent rise in literacy rate. There is also evidence to suggest a statistically significant relationship between literacy and both the country’s geographic subregion and its form of government, although it is noted that not all conditions were sufficiently satisfied for the analysis.

Part 1 - Introduction

It may be self-evident that the amount of money spent on education by a country will have an impact on the country’s literacy rate. But is there a statistically significant relationship? And can that relationship be quantified using a predictive model?

It is further presumed that literacy rates will be lower in poorer regions of the world and in those having forms of government in which the head of state holds more power and has less accountability to his or her constituents. This project seeks to validate those assumptions and to generate a model that will predict the change in literacy rate based on the studied parameters.

Part 2 - Data

The data came from several sources:

  • Regional data is from a public dataset on Github\(^1\).

  • Government spending on education is posted on worldbank.org and is collected annually from the UNESCO Institute for Statistics; data from the years 1960 to 2020 was available for download\(^2\).

  • Literacy rates were obtained from an aggregated dataset on wikimedia.org; the data was originally collected by worldbank.org, the CIA World Factbook, and other sources. The dataset includes some historical data as old as 1475 but with a majority of data points between 1960 and 2015\(^3\). For the purposes of this study, only data from 1960 or newer was used.

  • Forms of government were taken from Wikipedia\(^4\).

Data preparation included a few tidying steps:

  • Removing footnotes and general tidying of the data
  • Standardizing country codes across data sets
  • Standardizing field names
##########################
# Regions
##########################

# Load countries by region
# from https://raw.githubusercontent.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.csv
regions_full <- read.csv("https://raw.githubusercontent.com/mmippolito/cuny/main/data606/project/country_regions.csv")

# Standarize field names
regions <- regions_full %>%
  rename(
    "country_numeric_code" = "country.code",
    "country_code" = "alpha.3",
    "subregion" = "sub.region"
  )


##########################
# Government spending
##########################

# Load govt spending on education data set
# from https://data.worldbank.org/indicator/SE.XPD.TOTL.GD.ZS
edspending_full <- read.csv("https://raw.githubusercontent.com/mmippolito/cuny/main/data606/project/govt_ed_spending.csv")

# Standardize field names
edspending <- edspending_full %>%
  rename(
    "country" = "Country.Name",
    "country_code" = "Country.Code"
  ) %>%
  select(-`Indicator.Name`, -`Indicator.Code`, -`X`)

# Remove Xs from years in column names
edspending <- rename_with(edspending, function(x) ifelse(substr(x, 1, 1) == "X", substr(x, 2, 5), x))

# Gather columns
edspending <- edspending %>% gather(3:63, key = "year", value = "pct_gdp")

# Convert years to numeric
edspending$year <- as.numeric(edspending$year)


##########################
# Literacy rates
##########################

# Load literacy rates
# from https://commons.wikimedia.org/wiki/Data:Cross-country_literacy_rates_-_World_Bank,_CIA_World_Factbook,_and_other_sources_(OWID_2762).tab
lit_full <- read.csv("https://raw.githubusercontent.com/mmippolito/cuny/main/data606/project/cross-country-literacy-rates.csv")

# Standardize field names
lit <- lit_full %>%
    rename(
        "country" = "Entity",
        "country_code" = "Code",
        "year" = "Year",
        "lit_rate" = "Literacy.rates..World.Bank..CIA.World.Factbook..and.other.sources."
    ) %>%
    filter(year >= 1960)


##########################
# Forms of government
##########################

# Load forms of government from CSV if it exists, otherwise parse from Wikipedia
# from https://en.wikipedia.org/wiki/List_of_countries_by_system_of_government
if (url.exists("https://raw.githubusercontent.com/mmippolito/cuny/main/data606/project/govt_forms.csv")) {
    govts <- read.csv("https://raw.githubusercontent.com/mmippolito/cuny/main/data606/project/govt_forms.csv", header = T)
} else {
    # Scrape and parse tables
    govts_html <- read_html("https://en.wikipedia.org/wiki/List_of_countries_by_system_of_government", encoding = "UTF-8")
    govts_tables <- html_table(govts_html, fill = TRUE)
    govts <- data.frame(govts_tables[6])
    # Standarize field names
    govts <- govts %>%
        rename(
            country = Name, 
            govt = Constitutional.form, 
            head_of_state = Head.of.state, 
            exec_legitimacy = Basis.of.executive.legitimacy)
    # Remove footnotes
    govts$exec_legitimacy <- str_replace_all(govts$exec_legitimacy, '\\[.+?\\]', '')
    # Change provisional gov't with no head to "no" instead of "n/a"
    govts$head_of_state <- ifelse(govts$head_of_state == "n/a", "no", govts$head_of_state)
    # Lower case
    govts$govt <- tolower(govts$govt)
    govts$head_of_state <- tolower(govts$head_of_state)
    govts$exec_legitimacy <- tolower(govts$exec_legitimacy)
    # Standardize names
    govts <- govts %>%
        mutate(country = case_when(
            country == "Bahamas, The" ~ "Bahamas",
            country == "China, People's Republic of" ~ "China",
            country == "Congo, Democratic Republic of the" ~ "Democratic Republic of Congo",
            country == "Congo, Republic of the" ~ "Congo",
            country == "Côte d'Ivoire" ~ "Cote d'Ivoire",
            country == "Czech Republic" ~ "Czechia",
            country == "East Timor" ~ "Timor",
            country == "Federated States of Micronesia" ~ "Micronesia",
            country == "Gambia, The" ~ "Gambia",
            country == "Korea, North" ~ "North Korea",
            country == "Korea, South" ~ "South Korea",
            country == "São Tomé and Príncipe" ~ "Sao Tome and Principe",
            country == "Vatican City" ~ "Vatican",
            TRUE ~ country)
        )
    # Add country codes by joining to lit_sum
    govts <-govts %>% 
        left_join(
            lit %>% group_by(country, country_code) %>% summarize(n(), .groups = "keep")
            , by = c("country")) %>%
        select(country, govt, head_of_state, exec_legitimacy, country_code)
    # Save to CSV
    # Create short form of exec_legitimacy
    govts <- govts %>%
        mutate(exec_legit_short = case_when(
            exec_legitimacy == "all authority vested in absolute monarch" ~ 
                "having absolute authority",
            exec_legitimacy == "ministry is subject to parliamentary confidence" ~ 
                "accountable to legislature",
            exec_legitimacy == "monarch personally exercises power in concert with other institutions" ~ 
                "sharing power",
            exec_legitimacy == "no constitutionally-defined basis to current regime" ~ 
                "with no contsitutional legitimacy",
            exec_legitimacy == "power constitutionally linked to a single political movement" ~ 
                "constitutionally granted power by single party",
            exec_legitimacy == "presidency independent of legislature; ministry is subject to parliamentary confidence" ~ 
                "independent of and accountable to legislature",
            exec_legitimacy == "presidency is elected by legislature; ministry may be, or not be, subject to parliamentary confidence" ~ 
                "elected by legislature",
            exec_legitimacy == "presidency is independent of legislature" ~ 
                "independent of legislature",
            TRUE ~ '')
        )
    govts$govt_type_short <- paste0(govts$govt, " with ", govts$head_of_state, " head\n", govts$exec_legit_short)
}

Because the data came from disparate sources, there were gaps that had to be addressed before proceeding with analysis. For example, many countries had sparser data on literacy rates compared to government spending on education:

regions %>%
    select(country_code) %>%
    left_join(edspending, by = c("country_code")) %>%
    group_by(country_code) %>%
    summarize(edspending_year_count = n()) %>%
    full_join(lit, by = c("country_code")) %>%
    group_by(country_code, edspending_year_count) %>%
    summarize(litrate_year_count = n(), .groups = "keep") %>%
    full_join(govts, by = c("country_code")) %>%
    group_by(country_code, edspending_year_count, litrate_year_count) %>%
    summarize(govt_count = n(), .groups = "keep") %>%
    group_by() %>%
    summarize(countries = n(), ed_spending_year_count = sum(edspending_year_count, na.rm = T),
        litrate_year_count = sum(litrate_year_count, na.rm = T), govt_count = sum(govt_count, na.rm = T)) %>%
    kable(caption = "<i><font color=#000000><b>Table 1.</b> Summary of observations</font></i>") %>% 
    kable_styling(bootstrap_options = c("striped", "hover", "condensed"), font_size = 13)
Table 1. Summary of observations
countries ed_spending_year_count litrate_year_count govt_count
253 13149 1268 255

In addition, some countries had no country code listed, while others had no literacy rate or educational spending data:

regions %>%
    select(country_code) %>%
    left_join(edspending, by = c("country_code")) %>%
    group_by(country_code) %>%
    summarize(edspending_year_count = n()) %>%
    full_join(lit, by = c("country_code")) %>%
    group_by(country_code, edspending_year_count) %>%
    summarize(litrate_year_count = n(), .groups = "keep") %>%
    full_join(govts, by = c("country_code")) %>%
    group_by(country_code, edspending_year_count, litrate_year_count) %>%
    summarize(govt_count = n(), .groups = "keep") %>%
    arrange(country_code) %>%
    filter(is.na(edspending_year_count) | is.na(litrate_year_count) | is.na(govt_count)) %>%
    kable(caption = "<i><font color=#000000><b>Table 1.5.</b> Data gaps</font></i>") %>% 
    kable_styling(bootstrap_options = c("striped", "hover", "condensed"), font_size = 13)
Table 1.5. Data gaps
country_code edspending_year_count litrate_year_count govt_count
NA 109 1
OWID_KOS NA 1 1
OWID_WRL NA 4 1
NA NA NA 3

For these reasons, the data couldn’t be reliably compared on a year-by-year basis. Instead, the data was taken as an aggregate, using mean values for literacy rate and educational spending per country.

##########################
# Data aggregation
##########################

# Calculate mean literacy rate per country
lit_sum <- lit %>% 
    group_by(country, country_code) %>%
    summarize(lit_rate = mean(lit_rate, na.rm = T), .groups = "keep")

# Calculate mean education spending per country
ed_sum <- edspending %>% group_by(country, country_code) %>%
    summarize(pct_gdp = mean(pct_gdp, na.rm = T), .groups = "keep")

# Join the summarized tables
j <- lit_sum %>% 
    full_join(ed_sum, by = c("country_code")) %>%
    full_join(govts, by = c("country_code")) %>%
    left_join(regions, by = c("country_code"))

# Filter out rows with no country code or subregion; these are regional aggregations
j <- j %>%
    filter(str_length(country_code) > 0 & str_length(region) > 0)

# Filter out NaNs
#j <- j %>%
#  filter(!is.na(pct_gdp)) %>%
#  filter(!is.na(lit_rate))

# Select only relevant fields
j <- j %>%
    select(country_code, country = country.x, region, subregion, 
        pct_gdp, lit_rate, govt, head_of_state, exec_legitimacy, exec_legit_short, govt_type_short)

# Add rankings
j$rank_pct_gdp <- rank(desc(j$pct_gdp))
j$rank_lit_rate <- rank(desc(j$lit_rate))

Part 3 - Exploratory data analysis

Data overview:

# Data overview
j %>%
    arrange(country_code) %>%
    kable(caption = "<i><font color=#000000><b>Table 2.</b> Sample data</font></i>") %>% 
    kable_styling(bootstrap_options = c("striped", "hover", "condensed"), font_size = 13)
Table 2. Sample data
country_code country region subregion pct_gdp lit_rate govt head_of_state exec_legitimacy exec_legit_short govt_type_short rank_pct_gdp rank_lit_rate
ABW Aruba Americas Latin America and the Caribbean 5.404377 97.21270 NA NA NA NA NA 48 71.0
AFG Afghanistan Asia Southern Asia 2.529187 29.35561 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 170 208.0
AGO Angola Africa Sub-Saharan Africa 3.483620 69.85356 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 127 166.0
AIA Anguilla Americas Latin America and the Caribbean NA 95.00000 NA NA NA NA NA 198 87.0
ALB Albania Europe Southern Europe 3.418164 97.25956 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 130 69.0
AND Andorra Europe Southern Europe 2.741496 100.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 158 4.0
ARE United Arab Emirates Asia Western Asia NaN 76.94260 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 217 153.0
ARG Argentina Americas Latin America and the Caribbean 3.317577 95.24479 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 137 85.0
ARM Armenia Asia Western Asia 2.694361 99.41624 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 160 20.0
ASM American Samoa Oceania Polynesia NaN 97.34416 NA NA NA NA NA 197 67.0
ATG Antigua and Barbuda Americas Latin America and the Caribbean 2.888497 98.95000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 154 47.0
AUS Australia Oceania Australia and New Zealand 5.151343 99.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 57 38.0
AUT Austria Europe Western Europe 5.257330 98.00000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 54 57.5
AZE Azerbaijan Asia Western Asia 3.109744 99.65141 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 143 13.0
BDI Burundi Africa Sub-Saharan Africa 4.565271 58.32817 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 82 183.0
BEL Belgium Europe Western Europe 5.556783 99.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 40 38.0
BEN Benin Africa Sub-Saharan Africa 2.794050 29.10703 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 155 209.0
BFA Burkina Faso Africa Sub-Saharan Africa 3.298072 22.66968 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 139 213.0
BGD Bangladesh Asia Southern Asia 1.678536 46.82022 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 191 195.0
BGR Bulgaria Europe Eastern Europe 3.805609 98.31486 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 111 51.0
BHR Bahrain Asia Western Asia 2.566467 86.11803 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 165 127.0
BHS Bahamas Americas Latin America and the Caribbean 2.232840 95.60000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 178 83.0
BIH Bosnia and Herzegovina Europe Southern Europe NaN 95.33726 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 200 84.0
BLR Belarus Europe Eastern Europe 5.239945 99.20330 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 56 24.0
BLZ Belize Americas Latin America and the Caribbean 6.272143 76.53762 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 20 154.0
BMU Bermuda Americas Northern America 2.544276 98.00000 NA NA NA NA NA 166 57.5
BOL Bolivia Americas Latin America and the Caribbean NaN 74.46010 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 199 156.0
BRA Brazil Americas Latin America and the Caribbean 5.080326 84.64864 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 58 132.0
BRB Barbados Americas Latin America and the Caribbean 5.537892 99.48404 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 42 17.0
BRN Brunei Asia South-eastern Asia 3.703406 90.21032 absolute monarchy executive all authority vested in absolute monarch having absolute authority absolute monarchy with executive head having absolute authority 118 113.0
BTN Bhutan Asia Southern Asia 6.021192 57.91837 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 25 184.0
BWA Botswana Africa Sub-Saharan Africa 5.993343 81.42539 republic executive presidency is elected by legislature; ministry may be, or not be, subject to parliamentary confidence elected by legislature republic with executive head elected by legislature 26 140.0
CAF Central African Republic Africa Sub-Saharan Africa 1.740243 35.20220 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 188 205.0
CAN Canada Americas Northern America 6.197651 99.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 21 38.0
CHE Switzerland Europe Western Europe 4.689695 99.00000 republic executive presidency is elected by legislature; ministry may be, or not be, subject to parliamentary confidence elected by legislature republic with executive head elected by legislature 75 38.0
CHL Chile Americas Latin America and the Caribbean 3.691271 93.57834 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 119 98.0
CHN China Asia Eastern Asia 1.844865 85.13846 republic ceremonial power constitutionally linked to a single political movement constitutionally granted power by single party republic with ceremonial head constitutionally granted power by single party 187 131.0
CIV Cote d’Ivoire Africa Sub-Saharan Africa 4.928473 40.69545 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 68 202.0
CMR Cameroon Africa Sub-Saharan Africa 2.897598 65.31628 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 152 175.0
COD Democratic Republic of Congo Africa Sub-Saharan Africa 1.607514 70.15435 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 192 165.0
COG Congo Africa Sub-Saharan Africa 5.019531 79.31117 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 59 146.0
COK Cook Islands Oceania Polynesia NA 95.00000 NA NA NA NA NA 202 87.0
COL Colombia Americas Latin America and the Caribbean 3.874822 86.52842 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 106 123.0
COM Comoros Africa Sub-Saharan Africa 2.766659 68.02978 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 156 170.0
CPV Cape Verde Africa Sub-Saharan Africa 5.841645 79.15245 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 31 147.0
CRI Costa Rica Americas Latin America and the Caribbean 5.588009 91.13427 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 37 107.0
CUB Cuba Americas Latin America and the Caribbean 9.324697 92.31931 republic executive power constitutionally linked to a single political movement constitutionally granted power by single party republic with executive head constitutionally granted power by single party 3 105.0
CUW NA Americas Latin America and the Caribbean 4.930950 NA NA NA NA NA NA 67 215.0
CYM Cayman Islands Americas Latin America and the Caribbean NaN 98.86782 NA NA NA NA NA 201 48.0
CYP Cyprus Asia Western Asia 4.818381 97.22608 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 72 70.0
CZE Czechia Europe Eastern Europe 4.162092 99.00000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 93 38.0
DEU Germany Europe Western Europe 4.667312 99.00000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 76 38.0
DJI Djibouti Africa Sub-Saharan Africa 6.866364 67.90000 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 12 171.0
DMA Dominica Americas Latin America and the Caribbean 4.608076 94.00000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 80 94.0
DNK Denmark Europe Northern Europe 7.190932 99.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 10 38.0
DOM Dominican Republic Americas Latin America and the Caribbean 1.555551 77.72348 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 193 151.0
DZA Algeria Africa Northern Africa 6.038817 69.37950 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 24 167.0
ECU Ecuador Americas Latin America and the Caribbean 3.705038 83.11557 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 117 138.0
EGY Egypt Africa Northern Africa 4.600963 63.64481 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 81 177.0
ERI Eritrea Africa Sub-Saharan Africa 3.481282 66.38323 republic executive power constitutionally linked to a single political movement constitutionally granted power by single party republic with executive head constitutionally granted power by single party 128 174.0
ESP Spain Europe Southern Europe 3.724955 97.32185 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 115 68.0
EST Estonia Europe Northern Europe 5.414394 99.80073 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 46 9.0
ETH Ethiopia Africa Sub-Saharan Africa 3.826884 36.15184 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 109 204.0
FIN Finland Europe Northern Europe 5.825813 100.00000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 32 4.0
FJI Fiji Oceania Melanesia 5.310019 93.70000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 52 95.0
FRA France Europe Western Europe 4.619930 99.00000 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 78 38.0
FRO NA Europe Northern Europe NaN NA NA NA NA NA NA 220 216.0
FSM NA Oceania Micronesia 8.513233 NA NA NA NA NA NA 5 219.0
GAB Gabon Africa Sub-Saharan Africa 3.100981 79.90022 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 144 145.0
GBR United Kingdom Europe Northern Europe 4.948231 99.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 64 38.0
GEO Georgia Asia Western Asia 2.900634 99.72141 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 151 11.0
GHA Ghana Africa Sub-Saharan Africa 4.720397 68.65681 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 74 169.0
GIB Gibraltar Europe Southern Europe NaN 80.00000 NA NA NA NA NA 204 144.0
GIN Guinea Africa Sub-Saharan Africa 2.256420 26.50957 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 176 211.0
GMB Gambia Africa Sub-Saharan Africa 2.073105 48.92602 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 183 194.0
GNB Guinea-Bissau Africa Sub-Saharan Africa 2.619680 44.95455 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 164 197.0
GNQ Equatorial Guinea Africa Sub-Saharan Africa 2.187980 92.82023 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 180 103.0
GRC Greece Europe Southern Europe 2.184492 94.38848 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 181 92.0
GRD Grenada Americas Latin America and the Caribbean 3.550270 96.89724 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 124 75.0
GRL Greenland Americas Northern America NaN 100.00000 NA NA NA NA NA 205 4.0
GTM Guatemala Americas Latin America and the Caribbean 2.541393 57.17512 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 168 187.0
GUM Guam Oceania Micronesia NaN 98.52628 NA NA NA NA NA 206 50.0
GUY Guyana Americas Latin America and the Caribbean 5.977280 86.26466 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 28 125.0
HKG Hong Kong Asia Eastern Asia 3.086896 93.50000 NA NA NA NA NA 145 99.0
HND Honduras Americas Latin America and the Caribbean 4.060441 66.92830 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 100 172.0
HRV Croatia Europe Southern Europe 4.101622 98.31155 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 96 52.0
HTI Haiti Americas Latin America and the Caribbean 1.875111 31.75606 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 186 206.0
HUN Hungary Europe Eastern Europe 4.994239 99.06012 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 60 29.0
IDN Indonesia Asia South-eastern Asia 2.543464 88.81549 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 167 119.0
IMN NA Europe Northern Europe NaN NA NA NA NA NA NA 221 217.0
IND India Asia Southern Asia 3.625842 59.04709 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 122 181.0
IRL Ireland Europe Northern Europe 4.865915 99.00000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 71 38.0
IRN Iran Asia Southern Asia 3.869538 73.41727 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 107 159.0
IRQ Iraq Asia Western Asia 3.277447 77.76422 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 140 150.0
ISL Iceland Europe Northern Europe 6.697072 99.00000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 14 38.0
ISR Israel Asia Western Asia 6.065511 94.42570 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 23 90.0
ITA Italy Europe Southern Europe 4.236024 98.18531 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 91 54.0
JAM Jamaica Americas Latin America and the Caribbean 4.982682 85.51742 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 61 130.0
JOR Jordan Asia Western Asia 4.156999 90.54745 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 94 110.0
JPN Japan Asia Eastern Asia 4.035063 99.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 102 38.0
KAZ Kazakhstan Asia Central Asia 3.079483 99.14057 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 147 27.0
KEN Kenya Africa Sub-Saharan Africa 5.621169 77.46984 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 36 152.0
KGZ Kyrgyzstan Asia Central Asia 5.499907 99.14811 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 43 26.0
KHM Cambodia Asia South-eastern Asia 1.697035 74.15550 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 190 157.0
KIR NA Oceania Micronesia 7.706612 NA NA NA NA NA NA 9 218.0
KNA Saint Kitts and Nevis Americas Latin America and the Caribbean 3.393330 97.80000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 134 63.5
KOR South Korea Asia Eastern Asia 3.406843 97.96594 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 131 60.0
KWT Kuwait Asia Western Asia 4.627532 85.57383 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 77 129.0
LAO Laos Asia South-eastern Asia 2.318959 70.22771 republic executive power constitutionally linked to a single political movement constitutionally granted power by single party republic with executive head constitutionally granted power by single party 173 164.0
LBN Lebanon Asia Western Asia 2.223663 91.83177 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 179 106.0
LBR Liberia Africa Sub-Saharan Africa 2.139657 41.68448 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 182 201.0
LBY Libya Africa Northern Africa 2.264170 80.90334 provisional no no constitutionally-defined basis to current regime with no contsitutional legitimacy provisional with no head with no contsitutional legitimacy 175 141.0
LCA Saint Lucia Americas Latin America and the Caribbean 4.343116 90.10000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 86 114.0
LIE Liechtenstein Europe Western Europe 2.245480 100.00000 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 177 4.0
LKA Sri Lanka Asia Southern Asia 2.535103 90.43716 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 169 112.0
LSO Lesotho Africa Sub-Saharan Africa 8.653212 80.47186 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 4 142.0
LTU Lithuania Europe Northern Europe 4.958919 99.43147 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 63 19.0
LUX Luxembourg Europe Western Europe 3.650740 100.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 120 4.0
LVA Latvia Europe Northern Europe 5.337286 99.74686 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 51 10.0
MAC Macao Asia Eastern Asia 2.678659 93.40819 NA NA NA NA NA 161 100.0
MAF NA Americas Latin America and the Caribbean NaN NA NA NA NA NA NA 223 222.0
MAR Morocco Africa Northern Africa 5.246433 53.45492 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 55 189.0
MCO Monaco Europe Western Europe 1.235655 99.00000 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 195 38.0
MDA Moldova Europe Eastern Europe 6.680688 97.90480 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 15 61.0
MDG Madagascar Africa Sub-Saharan Africa 2.628151 66.60780 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 163 173.0
MDV Maldives Asia Southern Asia 4.481600 94.41717 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 83 91.0
MEX Mexico Americas Latin America and the Caribbean 4.274014 88.98518 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 89 118.0
MHL Marshall Islands Oceania Micronesia 11.253536 98.26508 republic executive presidency is elected by legislature; ministry may be, or not be, subject to parliamentary confidence elected by legislature republic with executive head elected by legislature 1 53.0
MKD North Macedonia Europe Southern Europe 4.294133 96.44580 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 88 77.0
MLI Mali Africa Sub-Saharan Africa 3.315431 25.19784 provisional no no constitutionally-defined basis to current regime with no contsitutional legitimacy provisional with no head with no contsitutional legitimacy 138 212.0
MLT Malta Europe Southern Europe 4.613346 90.65190 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 79 108.0
MMR Myanmar Asia South-eastern Asia 1.915140 88.63134 provisional no no constitutionally-defined basis to current regime with no contsitutional legitimacy provisional with no head with no contsitutional legitimacy 185 120.0
MNE Montenegro Europe Southern Europe NaN 95.60674 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 207 82.0
MNG Mongolia Asia Eastern Asia 4.941291 98.13116 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 66 55.0
MNP Northern Mariana Islands Oceania Micronesia NaN 97.00000 NA NA NA NA NA 212 73.0
MOZ Mozambique Africa Sub-Saharan Africa 4.450694 44.67777 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 85 198.0
MRT Mauritania Africa Sub-Saharan Africa 2.049036 49.61167 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 184 193.0
MSR Montserrat Americas Latin America and the Caribbean NA 97.00000 NA NA NA NA NA 208 73.0
MUS Mauritius Africa Sub-Saharan Africa 3.971570 88.53835 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 105 121.0
MWI Malawi Africa Sub-Saharan Africa 4.003376 59.98611 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 103 180.0
MYS Malaysia Asia South-eastern Asia 5.483972 85.77487 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 44 128.0
NAM Namibia Africa Sub-Saharan Africa 6.927564 83.51319 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 11 137.0
NCL New Caledonia Oceania Melanesia NaN 94.85268 NA NA NA NA NA 209 89.0
NER Niger Africa Sub-Saharan Africa 2.744534 19.40194 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 157 214.0
NGA Nigeria Africa Sub-Saharan Africa 3.136930 55.21642 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 142 188.0
NIC Nicaragua Americas Latin America and the Caribbean 3.487388 63.69006 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 126 176.0
NIU Niue Oceania Polynesia NA 95.00000 NA NA NA NA NA 210 87.0
NLD Netherlands Europe Western Europe 5.411029 99.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 47 38.0
NOR Norway Europe Northern Europe 6.613507 100.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 17 4.0
NPL Nepal Asia Southern Asia 3.730152 45.28982 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 113 196.0
NRU NA Oceania Micronesia 4.246150 NA NA NA NA NA NA 90 220.0
NZL New Zealand Oceania Australia and New Zealand 5.548615 99.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 41 38.0
OMN Oman Asia Western Asia 3.643375 88.22780 absolute monarchy executive all authority vested in absolute monarch having absolute authority absolute monarchy with executive head having absolute authority 121 122.0
PAK Pakistan Asia Southern Asia 2.342144 51.07102 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 172 191.0
PAN Panama Americas Latin America and the Caribbean 3.807270 84.24272 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 110 134.0
PER Peru Americas Latin America and the Caribbean 3.211311 84.22014 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 141 135.0
PHL Philippines Asia South-eastern Asia 2.649313 92.93114 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 162 102.0
PLW Palau Oceania Micronesia 7.757654 96.47849 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 8 76.0
PNG Papua New Guinea Oceania Melanesia 4.133172 61.29095 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 95 178.0
POL Poland Europe Eastern Europe 4.916595 99.46492 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 70 18.0
PRI Puerto Rico Americas Latin America and the Caribbean 6.722450 90.43851 NA NA NA NA NA 13 111.0
PRK North Korea Asia Eastern Asia NaN 99.99875 republic executive power constitutionally linked to a single political movement constitutionally granted power by single party republic with executive head constitutionally granted power by single party 211 8.0
PRT Portugal Europe Southern Europe 4.167017 89.32215 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 92 117.0
PRY Paraguay Americas Latin America and the Caribbean 3.079762 86.37620 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 146 124.0
PSE Palestine Asia Western Asia 5.567826 94.15226 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 38 93.0
PYF French Polynesia Oceania Polynesia NaN 98.00000 NA NA NA NA NA 203 57.5
QAT Qatar Asia Western Asia 3.369394 92.66726 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 135 104.0
ROU Romania Europe Eastern Europe 3.402827 97.84222 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 132 62.0
RUS Russia Europe Eastern Europe 3.764455 99.20772 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 112 23.0
RWA Rwanda Africa Sub-Saharan Africa 3.718046 61.06872 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 116 179.0
SAU Saudi Arabia Asia Western Asia 5.959900 84.45981 absolute monarchy executive all authority vested in absolute monarch having absolute authority absolute monarchy with executive head having absolute authority 29 133.0
SDN Sudan Africa Northern Africa 1.716389 57.82152 provisional no no constitutionally-defined basis to current regime with no contsitutional legitimacy provisional with no head with no contsitutional legitimacy 189 185.0
SEN Senegal Africa Sub-Saharan Africa 4.075480 44.03210 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 98 199.0
SGP Singapore Asia South-eastern Asia 3.006399 93.66474 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 150 96.0
SHN Saint Helena Africa Sub-Saharan Africa NA 97.00000 NA NA NA NA NA 213 73.0
SLB Solomon Islands Oceania Melanesia 6.559613 80.35000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 18 143.0
SLE Sierra Leone Africa Sub-Saharan Africa 3.577896 43.48164 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 123 200.0
SLV El Salvador Americas Latin America and the Caribbean 3.448316 73.05684 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 129 160.0
SMR San Marino Europe Southern Europe 3.073748 96.00000 republic executive presidency is elected by legislature; ministry may be, or not be, subject to parliamentary confidence elected by legislature republic with executive head elected by legislature 148 79.0
SOM Somalia Africa Sub-Saharan Africa 1.230985 37.80000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 196 203.0
SPM Saint Pierre and Miquelon Americas Northern America NA 99.00000 NA NA NA NA NA 214 38.0
SRB Serbia Europe Southern Europe 4.047541 97.45418 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 101 66.0
SSD South Sudan Africa Sub-Saharan Africa 1.245862 29.40376 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 194 207.0
STP Sao Tome and Principe Africa Sub-Saharan Africa 5.362461 77.81696 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 49 149.0
SUR Suriname Americas Latin America and the Caribbean NaN 93.60843 republic executive presidency is elected by legislature; ministry may be, or not be, subject to parliamentary confidence elected by legislature republic with executive head elected by legislature 215 97.0
SVK Slovakia Europe Eastern Europe 4.067071 99.60000 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 99 16.0
SVN Slovenia Europe Southern Europe 5.302957 99.65028 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 53 14.0
SWE Sweden Europe Northern Europe 6.625000 99.00000 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 16 38.0
SWZ Eswatini Africa Sub-Saharan Africa 5.700893 74.95872 absolute monarchy executive all authority vested in absolute monarch having absolute authority absolute monarchy with executive head having absolute authority 34 155.0
SXM NA Americas Latin America and the Caribbean NaN NA NA NA NA NA NA 222 221.0
SYC Seychelles Africa Sub-Saharan Africa 5.991766 90.63043 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 27 109.0
SYR Syria Asia Western Asia 4.961290 78.32140 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 62 148.0
TCA Turks and Caicos Islands Americas Latin America and the Caribbean 3.996080 98.00000 NA NA NA NA NA 104 57.5
TCD Chad Africa Sub-Saharan Africa 2.274928 28.79964 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 174 210.0
TGO Togo Africa Sub-Saharan Africa 4.309644 58.82138 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 87 182.0
THA Thailand Asia South-eastern Asia 3.526057 93.04179 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 125 101.0
TJK Tajikistan Asia Central Asia 3.402746 99.17368 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 133 25.0
TKM Turkmenistan Asia Central Asia 3.049250 99.38137 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 149 21.0
TLS Timor Asia South-eastern Asia 8.501869 52.64378 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 6 190.0
TON Tonga Oceania Polynesia 5.341516 99.25994 constitutional monarchy executive monarch personally exercises power in concert with other institutions sharing power constitutional monarchy with executive head sharing power 50 22.0
TTO Trinidad and Tobago Americas Latin America and the Caribbean 3.867510 97.61729 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 108 65.0
TUN Tunisia Africa Northern Africa 6.075683 72.92872 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 22 161.0
TUR Turkey Asia Western Asia 2.508344 86.25201 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 171 126.0
TUV NA Oceania Polynesia 5.642505 NA NA NA NA NA NA 35 223.0
TWN Taiwan Asia Eastern Asia NA 96.10000 NA NA NA NA NA 216 78.0
TZA Tanzania Africa Sub-Saharan Africa 3.327046 70.96110 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 136 163.0
UGA Uganda Africa Sub-Saharan Africa 2.712810 68.80716 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 159 168.0
UKR Ukraine Europe Eastern Europe 5.566057 99.64933 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 39 15.0
URY Uruguay Americas Latin America and the Caribbean 2.895334 95.95549 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 153 80.0
USA United States Americas Northern America 4.946395 99.13333 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 65 28.0
UZB Uzbekistan Asia Central Asia 5.770146 99.65330 republic executive presidency independent of legislature; ministry is subject to parliamentary confidence independent of and accountable to legislature republic with executive head independent of and accountable to legislature 33 12.0
VAT Vatican Europe Southern Europe NA 100.00000 absolute monarchy executive all authority vested in absolute monarch having absolute authority absolute monarchy with executive head having absolute authority 218 4.0
VCT Saint Vincent and the Grenadines Americas Latin America and the Caribbean 5.857815 95.63216 constitutional monarchy ceremonial ministry is subject to parliamentary confidence accountable to legislature constitutional monarchy with ceremonial head accountable to legislature 30 81.0
VEN Venezuela Americas Latin America and the Caribbean 4.480655 83.86176 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 84 136.0
VGB British Virgin Islands Americas Latin America and the Caribbean 4.723506 97.80000 NA NA NA NA NA 73 63.5
VIR NA Americas Latin America and the Caribbean NaN NA NA NA NA NA NA 224 224.0
VNM Vietnam Asia South-eastern Asia 4.918966 89.98192 republic executive power constitutionally linked to a single political movement constitutionally granted power by single party republic with executive head constitutionally granted power by single party 69 115.0
VUT Vanuatu Oceania Melanesia 6.362590 73.83074 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 19 158.0
WLF Wallis and Futuna Oceania Polynesia NA 50.00000 NA NA NA NA NA 219 192.0
WSM Samoa Oceania Polynesia 4.095548 98.61827 republic ceremonial ministry is subject to parliamentary confidence accountable to legislature republic with ceremonial head accountable to legislature 97 49.0
YEM Yemen Asia Western Asia 8.011537 57.51014 provisional no no constitutionally-defined basis to current regime with no contsitutional legitimacy provisional with no head with no contsitutional legitimacy 7 186.0
ZAF South Africa Africa Sub-Saharan Africa 5.461569 89.85127 republic executive presidency is elected by legislature; ministry may be, or not be, subject to parliamentary confidence elected by legislature republic with executive head elected by legislature 45 116.0
ZMB Zambia Africa Sub-Saharan Africa 3.729464 71.95042 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 114 162.0
ZWE Zimbabwe Africa Sub-Saharan Africa 9.576959 82.94074 republic executive presidency is independent of legislature independent of legislature republic with executive head independent of legislature 2 139.0

Literacy rates (dependent variable):

# Summary statistics for literacy rate
describe(j$lit_rate) %>%
    kable(caption = "<i><font color=#000000><b>Table 3.</b> Summary stats - literacy rate</font></i>") %>% 
    kable_styling(bootstrap_options = c("striped", "hover", "condensed"), font_size = 13)
Table 3. Summary stats - literacy rate
vars n mean sd median trimmed mad min max range skew kurtosis se
X1 1 214 82.51319 20.33653 90.89308 86.11195 12.01932 19.40194 100 80.59806 -1.300363 0.7319961 1.390177
# Histogram of literacy rate
j %>%
    drop_na(lit_rate) %>%
    ggplot() +
    geom_histogram(aes(x = lit_rate), bins = 25, fill = 'lightblue') +
    xlab("Literacy rate") + ylab("Countries") +
    ggtitle("Figure 1. Literacy rate") + 
    theme_light()

Educational spending (independent, numerical variable):

# Summary statistics for percent GDP education spending
describe(j$pct_gdp) %>%
    kable(caption = "<i><font color=#000000><b>Table 4.</b> Summary stats - educational spending</font></i>") %>% 
    kable_styling(bootstrap_options = c("striped", "hover", "condensed"), font_size = 13)
Table 4. Summary stats - educational spending
vars n mean sd median trimmed mad min max range skew kurtosis se
X1 1 196 4.27805 1.70355 4.071276 4.161513 1.74287 1.230985 11.25354 10.02255 0.8118612 1.173398 0.1216821
# Histogram of GDP education spending
j %>%
    drop_na(pct_gdp) %>%
    ggplot() +
    geom_histogram(aes(x = pct_gdp), bins = 20, fill = 'lightblue') +
    xlab("% GDP") + ylab("Countries") +
    ggtitle("Figure 2. Percentage of GDP Spent on Education") +
    theme_light()

Regions (independent, categorical variable):

# Regions table
regions %>% 
    group_by(region, subregion) %>%
    summarize(n = n(), .groups = "keep") %>%
    select(-n) %>% 
    arrange(region, subregion) %>%
    kable(caption = "<i><font color=#000000><b>Table 4.5.</b> Regions</font></i>") %>% 
    kable_styling(bootstrap_options = c("striped", "hover", "condensed"), font_size = 13)
Table 4.5. Regions
region subregion
Africa Northern Africa
Africa Sub-Saharan Africa
Americas Latin America and the Caribbean
Americas Northern America
Asia Central Asia
Asia Eastern Asia
Asia South-eastern Asia
Asia Southern Asia
Asia Western Asia
Europe Eastern Europe
Europe Northern Europe
Europe Southern Europe
Europe Western Europe
Oceania Australia and New Zealand
Oceania Melanesia
Oceania Micronesia
Oceania Polynesia
# Bar chart of regions
j %>%
    drop_na(subregion) %>%
    group_by(subregion) %>%
    summarize(n = n()) %>%
    ggplot() +
    geom_bar(aes(x = reorder(subregion, n), y = n), fill = 'lightblue', stat = "identity") +
    xlab("Subregion") + ylab("Countries") +
    ggtitle("Figure 3. Subregions") +
    theme_light() +
    coord_flip()

Forms of government (independent, categorical variable):

# Governments table
govts %>% 
    group_by(govt, head_of_state, exec_legitimacy) %>%
    summarize(num_countries = n(), .groups = "keep") %>%
    arrange(desc(num_countries)) %>%
    kable(caption = "<i><font color=#000000><b>Table 4.7.</b> Forms of government</font></i>") %>% 
    kable_styling(bootstrap_options = c("striped", "hover", "condensed"), font_size = 13)
Table 4.7. Forms of government
govt head_of_state exec_legitimacy num_countries
republic executive presidency is independent of legislature 61
republic ceremonial ministry is subject to parliamentary confidence 41
constitutional monarchy ceremonial ministry is subject to parliamentary confidence 29
republic executive presidency independent of legislature; ministry is subject to parliamentary confidence 29
constitutional monarchy executive monarch personally exercises power in concert with other institutions 10
republic executive presidency is elected by legislature; ministry may be, or not be, subject to parliamentary confidence 9
absolute monarchy executive all authority vested in absolute monarch 5
provisional no no constitutionally-defined basis to current regime 5
republic executive power constitutionally linked to a single political movement 5
republic ceremonial power constitutionally linked to a single political movement 1
# Bar chart of governments
govts %>%
    group_by(govt_type_short) %>%
    summarize(n = n(), .groups = "keep") %>%
    ggplot() +
    geom_bar(aes(x = reorder(govt_type_short, n), y = n), fill = 'lightblue', stat = "identity") +
    xlab("Form of goverment") + ylab("Countries") +
    ggtitle("Figure 4. Forms of government") +
    theme_light() +
    coord_flip()

Explore relationships between explanatory and response variables:

# Scatter plot of literacy rate vs education spending
j %>% 
    drop_na(pct_gdp, lit_rate) %>%
    ggplot() +
    geom_point(aes(x = pct_gdp, y = lit_rate)) +
    theme_light() +
    xlab("Percent GDP") +
    ylab("Literacy rate") +
    ggtitle("Figure 5. Literacy rate vs educational spending")

# Box plots of literacy rate by region
j %>%
    drop_na(lit_rate) %>%
    ggplot() +
    geom_boxplot(aes(x = reorder(subregion, -lit_rate), y = lit_rate)) +
    coord_flip() +
    theme_light() +
    xlab("Subregion") +
    ylab("Literacy rate") +
    ggtitle("Figure 6. Literacy rate by subregion")

# Box plots of literacy rate by form of government
j %>%
    drop_na(lit_rate) %>%
    drop_na(govt_type_short) %>%
    ggplot() +
    geom_boxplot(aes(x = reorder(govt_type_short, -lit_rate), y = lit_rate)) +
    xlab("Form of goverment") + ylab("Literacy rate") +
    ggtitle("Figure 7. Literacy rate by form of government") +
    theme_light() +
    coord_flip()

# Set world class for maps
world <- ne_countries(scale = "medium", returnclass = "sf", type = "countries")

# Map of literacy rate
world %>%
    inner_join(j, by = c("iso_a3" = "country_code")) %>%
    drop_na(lit_rate) %>%
    ggplot() +
    geom_sf(aes(fill = lit_rate)) +
    scale_fill_viridis_c(option = "cividis", trans = "sqrt", direction = -1) +
    ggtitle("Figure 8. Literacy rate") +
    labs(fill = "Literacy rate")

Explore independence of explanatory variables:

# Box plots of ed spending by subregion
j %>%
    drop_na(pct_gdp) %>%
    ggplot() +
    geom_boxplot(aes(x = reorder(subregion, -pct_gdp), y = pct_gdp)) +
    coord_flip() +
    theme_light() +
    xlab("Subregion") +
    ylab("% GDP") +
    ggtitle("Figure 9. Educational spending by subregion")

# Box plots of ed spending by form of government
j %>%
    drop_na(pct_gdp, govt_type_short) %>%
    ggplot() +
    geom_boxplot(aes(x = reorder(govt_type_short, -pct_gdp), y = pct_gdp)) +
    coord_flip() +
    theme_light() +
    xlab("Form of government") +
    ylab("% GDP") +
    ggtitle("Figure 10. Educational spending by form of government")

# Bar plot of form of government by region
j %>%
    drop_na(govt, region) %>%
    ggplot() +
    geom_bar(aes(x = region, fill = govt), position = "dodge") +
    coord_flip() +
    theme_light() +
    xlab("Region") +
    ylab("Countries") +
    ggtitle("Figure 11. Form of government by region")

# Map of subregions
world %>%
    inner_join(j, by = c("iso_a3" = "country_code"))  %>%
    ggplot() +
    geom_sf(aes(fill = subregion.y)) +
    ggtitle("Figure 12. Subregions of the world") +
    labs(fill = "Subregion")

# Map of forms of government
world %>%
    inner_join(govts, by = c("iso_a3" = "country_code")) %>%
    ggplot() +
    geom_sf(aes(fill = govt)) +
    scale_fill_brewer(palette="PuBu") +
    ggtitle("Figure 13. Forms of government") +
    labs(fill = "Government")

# Map of educational spending
world %>%
    inner_join(j, by = c("iso_a3" = "country_code")) %>%
    drop_na(pct_gdp) %>%
    ggplot() +
    geom_sf(aes(fill = pct_gdp)) +
    scale_fill_viridis_c(option = "cividis", trans = "sqrt", direction = -1) +
    ggtitle("Figure 14. Educational spending") +
    labs(fill = "% GDP")

Part 4 - Inference

One goal of the project was to evaluate whether there is a statistically significant difference in literacy rate and educational spending across regions as well as across government types. To evaluate this, a series of ANOVA analyses were performed. The null hypothesis for each analysis was that there was no difference in rate for the variable in question; for example, for the first test, \(H_0\) = there is no difference in educational spending rate among subregions. The alternative hypothesis would be the opposite: \(H_A\) = there is a statistically significant difference in educational spending rate among subregions. Similar comparisons were made for the remaining ANOVA tests.

It is noted that not all of the conditions for ANOVA were met. Independence was assumed, but while education spending was fairly normal across subregions and government types, the same could not be said of literacy rate, which was strongly left-skewed. Similarly, the box plots also show that variance was not constant for literacy rates, while it was more constant for educational spending.

# Literacy rates by subregion
region_summ <- j %>% 
    group_by(region, subregion) %>%
    summarize(
        n_pct_gdp = n(),
        sd_pct_gdp = sd(pct_gdp, na.rm = T),
        mean_pct_gdp = mean(pct_gdp, na.rm = T),
        n_lit_rate = n(),
        sd_lit_rate = sd(lit_rate, na.rm = T),
        mean_lit_rate = mean(lit_rate, na.rm = T),
        .groups = "keep"
    )

# Literacy rates by govt
govt_summ <- j %>% 
    drop_na(govt_type_short) %>%
    group_by(govt_type_short) %>%
    summarize(
        n_pct_gdp = n(),
        sd_pct_gdp = sd(pct_gdp, na.rm = T),
        mean_pct_gdp = mean(pct_gdp, na.rm = T),
        n_lit_rate = n(),
        sd_lit_rate = sd(lit_rate, na.rm = T),
        mean_lit_rate = mean(lit_rate, na.rm = T),
        .groups = "keep"
    ) %>%
    mutate(sd_pct_gdp = ifelse(is.na(sd_pct_gdp), 0, sd_pct_gdp)) %>%
    mutate(sd_lit_rate = ifelse(is.na(sd_lit_rate), 0, sd_lit_rate))

# Find overall rate - ed spending
mean_pct_gdp = mean(j$pct_gdp, na.rm = T)
sd_pct_gdp = sd(j$pct_gdp, na.rm = T)
print(paste0("Mean spending on education across all countries = ", round(mean_pct_gdp, 3), "%, sd = ", round(sd_pct_gdp, 3)))
## [1] "Mean spending on education across all countries = 4.278%, sd = 1.704"
# Find overall rate - literacy rate
mean_lit_rate = mean(j$lit_rate, na.rm = T)
sd_lit_rate = sd(j$lit_rate, na.rm = T)
print(paste0("Mean literacy rate across all countries = ", round(mean_lit_rate, 3), "%, sd = ", round(sd_lit_rate, 3)))
## [1] "Mean literacy rate across all countries = 82.513%, sd = 20.337"
print("")
## [1] ""
# Histograms - ed spending by subregion
j %>%
    drop_na(pct_gdp) %>%
    ggplot(aes(x = pct_gdp)) +
    geom_histogram(binwidth = 0.5) +
    facet_wrap(~subregion, ncol = 3) + 
    ggtitle("Figure 15. Educational spending by subregion") +
    xlab("Educational spending (% GDP)") + ylab("")

# Histograms - literacy rate by subregion
j %>%
    drop_na(lit_rate) %>%
    ggplot(aes(x = lit_rate)) +
    geom_histogram(binwidth = 7) +
    facet_wrap(~subregion, ncol = 3) + 
    ggtitle("Figure 16. Literacy rate by subregion") +
    xlab("Literacy rate (%)") + ylab("")

# Histograms - ed spending by govt
j %>%
    drop_na(pct_gdp) %>%
    ggplot(aes(x = pct_gdp)) +
    geom_histogram(binwidth = 0.5) +
    facet_wrap(~govt_type_short, ncol = 3) + 
    ggtitle("Figure 17. Educational spending by government type") +
    xlab("Educational spending (% GDP)") + ylab("")

# Histograms - literacy rate by govt
j %>%
    drop_na(lit_rate) %>%
    ggplot(aes(x = lit_rate)) +
    geom_histogram(binwidth = 7) +
    facet_wrap(~govt_type_short, ncol = 3) + 
    ggtitle("Figure 18. Literacy rate by government type") +
    xlab("Literacy rate (%)") + ylab("")

# ANOVA - ed spending vs subregion
aov_ed_region <- aov(pct_gdp ~ subregion, data = j)
print(paste0("ANOVA results - educational spending vs subregion"))
## [1] "ANOVA results - educational spending vs subregion"
summary(aov_ed_region)
##              Df Sum Sq Mean Sq F value   Pr(>F)    
## subregion    16  128.1   8.006   3.273 5.33e-05 ***
## Residuals   179  437.8   2.446                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 28 observations deleted due to missingness
# ANOVA - ed spending vs govt
aov_ed_govt <- aov(pct_gdp ~ govt_type_short, data = j)
print(paste0("ANOVA results - educational spending vs government type"))
## [1] "ANOVA results - educational spending vs government type"
summary(aov_ed_govt)
##                  Df Sum Sq Mean Sq F value Pr(>F)  
## govt_type_short   9   56.2   6.244   2.348 0.0159 *
## Residuals       174  462.8   2.660                 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 40 observations deleted due to missingness
# ANOVA - lit rate vs subregion
aov_lit_region <- aov(lit_rate ~ subregion, data = j)
print(paste0("ANOVA results - literacy rate vs subregion"))
## [1] "ANOVA results - literacy rate vs subregion"
summary(aov_lit_region)
##              Df Sum Sq Mean Sq F value Pr(>F)    
## subregion    16  48057  3003.5   14.78 <2e-16 ***
## Residuals   197  40035   203.2                   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 10 observations deleted due to missingness
# ANOVA - lit rate vs govt
aov_lit_govt <- aov(lit_rate ~ govt_type_short, data = j)
print(paste0("ANOVA results - literacy rate vs government type"))
## [1] "ANOVA results - literacy rate vs government type"
summary(aov_lit_govt)
##                  Df Sum Sq Mean Sq F value   Pr(>F)    
## govt_type_short   9  14384    1598    4.25 5.15e-05 ***
## Residuals       181  68065     376                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 33 observations deleted due to missingness

Next, a linear model was fit to the literacy rate vs ed spending data. It should be noted that not all of the conditions for least squares are not met:

  1. Linearity: The data appear to be fairly linear, with a positive relationship.
  2. Nearly normal residuals: As shown in the histogram and QQ plot, the residuals are significantly skewed to the left.
  3. Constant variability: Variability isn’t constant, but narrows for higher values.
  4. Independent observations: The observations are independent.

A second model was fit that ignored high-leverage points (percent gdp > 7.75%). Contrary to what I expected, the line didn’t change much.

# Linear model - literacy rate vs ed spending
lit_lm <- lm(lit_rate ~ pct_gdp, data = j, na.action = na.omit)
summary(lit_lm)
## 
## Call:
## lm(formula = lit_rate ~ pct_gdp, data = j, na.action = na.omit)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -56.631 -11.855   7.824  15.197  28.353 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  66.2369     3.9417  16.804  < 2e-16 ***
## pct_gdp       3.5691     0.8671   4.116 5.75e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 20.03 on 189 degrees of freedom
##   (33 observations deleted due to missingness)
## Multiple R-squared:  0.08227,    Adjusted R-squared:  0.07742 
## F-statistic: 16.94 on 1 and 189 DF,  p-value: 5.749e-05
# Line of best fit
j %>%
    drop_na(pct_gdp, lit_rate) %>%
    ggplot(aes(x = pct_gdp, y = lit_rate)) +
    geom_point() + 
    geom_smooth(formula = y ~ x, method = "lm", se = T) +
    coord_cartesian(ylim = c(0, 100)) +
    xlab("Government spending (% GDP)") + ylab("Literacy rate (%)") +
    ggtitle("Figure 19. Literacy rate vs educational spending")

# Residuals plot
lit_lm %>%
    ggplot(aes(x = .fitted, y = .resid)) + 
    geom_point() +
    geom_hline(yintercept = 0, linetype = "dashed") +
    xlab("Fitted values") + ylab("Residuals") +
    ggtitle("Figure 20. Fitted values vs residuals")

# Residuals histogram
lit_lm %>%
    ggplot(aes(x = .resid)) +
    geom_histogram(binwidth = 4) +
    xlab("Residuals") + ylab("Count") +
    ggtitle("Figure 21. Residuals histogram")

# Probability plot
lit_lm %>%
    ggplot(aes(sample = .resid)) +
    stat_qq() +
    xlab("Theoretical values") + ylab("Actual values") +
    ggtitle("Figure 22. Probability plot")

# Removing high-leverage/influential points
lit_lm_2 <- lm(lit_rate ~ pct_gdp, data = filter(j, pct_gdp < 7.75), na.action = na.omit)
summary(lit_lm_2)
## 
## Call:
## lm(formula = lit_rate ~ pct_gdp, data = filter(j, pct_gdp < 7.75), 
##     na.action = na.omit)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -55.135 -12.064   6.308  14.451  32.390 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   60.118      4.452   13.50  < 2e-16 ***
## pct_gdp        5.254      1.040    5.05 1.07e-06 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 19.7 on 182 degrees of freedom
##   (4 observations deleted due to missingness)
## Multiple R-squared:  0.1229, Adjusted R-squared:  0.1181 
## F-statistic:  25.5 on 1 and 182 DF,  p-value: 1.067e-06
j %>%
    drop_na(pct_gdp, lit_rate) %>%
    filter(pct_gdp < 7.75) %>%
    ggplot(aes(x = pct_gdp, y = lit_rate)) +
    geom_point() + 
    geom_smooth(formula = y ~ x, method = "lm", se = T) +
    coord_cartesian(ylim = c(0, 100)) +
    xlab("Fitted values") + ylab("Residuals") +
    ggtitle("Figure 22.5. Literacy rate vs educational spending (high-leverage values removed)")

One additional goal of the project was to evaluate whether adding the two categorical variables (subregion and government type) would influence the linear model. First, a backward elimination by p-value strategy was used to eliminate variables. But that resulted in removing the pct_gdp variable and ending up with two categorical variables having p-values greater than 0.05. So a different strategy was employed using forward selection.

# Prepare variables
incl_pct_gdp <- c('include', '', '', 'include', 'include', 'include')
incl_subregion <- c('', 'include', '', 'include', '', 'include')
incl_govt_type <- c('', '', 'include', '', 'include', 'include')
adjrsq <- c()

# Fit linear model - pct_gdp
lm_mult <- lm(lit_rate ~ pct_gdp, data = j)
adjrsq <- c(adjrsq, summary(lm_mult)$adj.r.squared)
summary(lm_mult)
## 
## Call:
## lm(formula = lit_rate ~ pct_gdp, data = j)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -56.631 -11.855   7.824  15.197  28.353 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  66.2369     3.9417  16.804  < 2e-16 ***
## pct_gdp       3.5691     0.8671   4.116 5.75e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 20.03 on 189 degrees of freedom
##   (33 observations deleted due to missingness)
## Multiple R-squared:  0.08227,    Adjusted R-squared:  0.07742 
## F-statistic: 16.94 on 1 and 189 DF,  p-value: 5.749e-05
# adj r-squared = 0.07742

# subregion
lm_mult <- lm(lit_rate ~ subregion, data = j)
adjrsq <- c(adjrsq, summary(lm_mult)$adj.r.squared)
summary(lm_mult)
## 
## Call:
## lm(formula = lit_rate ~ subregion, data = j)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -55.177  -2.589   0.404   7.421  36.752 
## 
## Coefficients:
##                                           Estimate Std. Error t value Pr(>|t|)
## (Intercept)                               99.00000   10.08022   9.821  < 2e-16
## subregionCentral Asia                      0.29941   11.92707   0.025 0.979998
## subregionEastern Asia                     -3.59469   11.27003  -0.319 0.750095
## subregionEastern Europe                   -0.07527   11.04233  -0.007 0.994568
## subregionLatin America and the Caribbean -12.06678   10.32915  -1.168 0.244127
## subregionMelanesia                       -18.19513   11.92707  -1.526 0.128730
## subregionMicronesia                       -1.43254   12.34569  -0.116 0.907743
## subregionNorthern Africa                 -32.64453   11.63963  -2.805 0.005543
## subregionNorthern America                  0.02667   11.92707   0.002 0.998218
## subregionNorthern Europe                   0.39791   11.04233   0.036 0.971291
## subregionPolynesia                        -8.53966   11.42989  -0.747 0.455873
## subregionSouth-eastern Asia              -15.35649   10.95835  -1.401 0.162683
## subregionSouthern Asia                   -38.13625   11.14410  -3.422 0.000756
## subregionSouthern Europe                  -3.62906   10.69169  -0.339 0.734649
## subregionSub-Saharan Africa              -38.75206   10.28388  -3.768 0.000217
## subregionWestern Asia                    -11.17725   10.62548  -1.052 0.294121
## subregionWestern Europe                    0.11111   11.14410   0.010 0.992055
##                                             
## (Intercept)                              ***
## subregionCentral Asia                       
## subregionEastern Asia                       
## subregionEastern Europe                     
## subregionLatin America and the Caribbean    
## subregionMelanesia                          
## subregionMicronesia                         
## subregionNorthern Africa                 ** 
## subregionNorthern America                   
## subregionNorthern Europe                    
## subregionPolynesia                          
## subregionSouth-eastern Asia                 
## subregionSouthern Asia                   ***
## subregionSouthern Europe                    
## subregionSub-Saharan Africa              ***
## subregionWestern Asia                       
## subregionWestern Europe                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.26 on 197 degrees of freedom
##   (10 observations deleted due to missingness)
## Multiple R-squared:  0.5455, Adjusted R-squared:  0.5086 
## F-statistic: 14.78 on 16 and 197 DF,  p-value: < 2.2e-16
# adj r-squared = 0.5086

# govt type
lm_mult <- lm(lit_rate ~ govt_type_short, data = j)
adjrsq <- c(adjrsq, summary(lm_mult)$adj.r.squared)
summary(lm_mult)
## 
## Call:
## lm(formula = lit_rate ~ govt_type_short, data = j)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -55.511  -7.458   5.459  11.145  26.619 
## 
## Coefficients:
##                                                                                              Estimate
## (Intercept)                                                                                   87.5713
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature        5.2831
## govt_type_shortconstitutional monarchy with executive head\nsharing power                     -3.4231
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                   -25.5585
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                       0.9695
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party  -2.4329
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party   -3.7891
## govt_type_shortrepublic with executive head\nelected by legislature                            5.4537
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature   -12.6579
## govt_type_shortrepublic with executive head\nindependent of legislature                      -14.6766
##                                                                                              Std. Error
## (Intercept)                                                                                      8.6723
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature          9.4149
## govt_type_shortconstitutional monarchy with executive head\nsharing power                       10.6214
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                      12.2645
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                         9.1859
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party    21.2428
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party     12.2645
## govt_type_shortrepublic with executive head\nelected by legislature                             11.7424
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature       9.3902
## govt_type_shortrepublic with executive head\nindependent of legislature                          9.0208
##                                                                                              t value
## (Intercept)                                                                                   10.098
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature        0.561
## govt_type_shortconstitutional monarchy with executive head\nsharing power                     -0.322
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                    -2.084
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                       0.106
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party  -0.115
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party   -0.309
## govt_type_shortrepublic with executive head\nelected by legislature                            0.464
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature    -1.348
## govt_type_shortrepublic with executive head\nindependent of legislature                       -1.627
##                                                                                              Pr(>|t|)
## (Intercept)                                                                                    <2e-16
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature        0.5754
## govt_type_shortconstitutional monarchy with executive head\nsharing power                      0.7476
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                     0.0386
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                       0.9161
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party   0.9089
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party    0.7577
## govt_type_shortrepublic with executive head\nelected by legislature                            0.6429
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature     0.1793
## govt_type_shortrepublic with executive head\nindependent of legislature                        0.1055
##                                                                                                 
## (Intercept)                                                                                  ***
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature         
## govt_type_shortconstitutional monarchy with executive head\nsharing power                       
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                   *  
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                        
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party    
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party     
## govt_type_shortrepublic with executive head\nelected by legislature                             
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature      
## govt_type_shortrepublic with executive head\nindependent of legislature                         
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 19.39 on 181 degrees of freedom
##   (33 observations deleted due to missingness)
## Multiple R-squared:  0.1745, Adjusted R-squared:  0.1334 
## F-statistic:  4.25 on 9 and 181 DF,  p-value: 5.15e-05
# adj r-squared = 0.1334

# Now start with pct_gdp type and add in subregion
lm_mult <- lm(lit_rate ~ pct_gdp + subregion, data = j)
adjrsq <- c(adjrsq, summary(lm_mult)$adj.r.squared)
summary(lm_mult)
## 
## Call:
## lm(formula = lit_rate ~ pct_gdp + subregion, data = j)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -48.675  -3.745   1.107   7.960  37.623 
## 
## Coefficients:
##                                          Estimate Std. Error t value Pr(>|t|)
## (Intercept)                               85.7399    10.4087   8.237 4.17e-14
## pct_gdp                                    2.4785     0.6754   3.670 0.000323
## subregionCentral Asia                      3.2480    11.5778   0.281 0.779399
## subregionEastern Asia                      0.5249    11.3536   0.046 0.963178
## subregionEastern Europe                    1.6350    10.7033   0.153 0.878771
## subregionLatin America and the Caribbean  -9.9564    10.0655  -0.989 0.323966
## subregionMelanesia                       -22.3053    11.9564  -1.866 0.063797
## subregionMicronesia                      -11.9280    14.0872  -0.847 0.398316
## subregionNorthern Africa                 -30.1010    11.2929  -2.665 0.008416
## subregionNorthern America                  1.6622    12.6132   0.132 0.895308
## subregionNorthern Europe                  -0.8357    10.6984  -0.078 0.937825
## subregionPolynesia                         1.5042    13.8114   0.109 0.913402
## subregionSouth-eastern Asia              -11.1689    10.6730  -1.046 0.296810
## subregionSouthern Asia                   -33.3619    10.8698  -3.069 0.002492
## subregionSouthern Europe                   1.0278    10.5937   0.097 0.922821
## subregionSub-Saharan Africa              -35.9655    10.0097  -3.593 0.000426
## subregionWestern Asia                     -7.5503    10.3518  -0.729 0.466760
## subregionWestern Europe                    3.0897    10.8222   0.285 0.775604
##                                             
## (Intercept)                              ***
## pct_gdp                                  ***
## subregionCentral Asia                       
## subregionEastern Asia                       
## subregionEastern Europe                     
## subregionLatin America and the Caribbean    
## subregionMelanesia                       .  
## subregionMicronesia                         
## subregionNorthern Africa                 ** 
## subregionNorthern America                   
## subregionNorthern Europe                    
## subregionPolynesia                          
## subregionSouth-eastern Asia                 
## subregionSouthern Asia                   ** 
## subregionSouthern Europe                    
## subregionSub-Saharan Africa              ***
## subregionWestern Asia                       
## subregionWestern Europe                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.8 on 173 degrees of freedom
##   (33 observations deleted due to missingness)
## Multiple R-squared:  0.6008, Adjusted R-squared:  0.5616 
## F-statistic: 15.32 on 17 and 173 DF,  p-value: < 2.2e-16
# adj r-squared = 0.5616 (higher than pct_gdp alone)

# pct_gdp type + govt_type
lm_mult <- lm(lit_rate ~ pct_gdp + govt_type_short, data = j)
adjrsq <- c(adjrsq, summary(lm_mult)$adj.r.squared)
summary(lm_mult)
## 
## Call:
## lm(formula = lit_rate ~ pct_gdp + govt_type_short, data = j)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -50.908  -9.014   4.168  11.318  31.083 
## 
## Coefficients:
##                                                                                              Estimate
## (Intercept)                                                                                   70.5917
## pct_gdp                                                                                        2.9194
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature        8.0302
## govt_type_shortconstitutional monarchy with executive head\nsharing power                      3.0655
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                   -18.6347
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                       5.2957
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party   9.1610
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party   -5.4925
## govt_type_shortrepublic with executive head\nelected by legislature                            4.5250
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature    -8.5559
## govt_type_shortrepublic with executive head\nindependent of legislature                       -8.7280
##                                                                                              Std. Error
## (Intercept)                                                                                     10.4672
## pct_gdp                                                                                          0.8901
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature         10.2362
## govt_type_shortconstitutional monarchy with executive head\nsharing power                       11.5340
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                      12.8982
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                        10.0650
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party    21.5651
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party     13.5424
## govt_type_shortrepublic with executive head\nelected by legislature                             12.9011
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature      10.2180
## govt_type_shortrepublic with executive head\nindependent of legislature                          9.9271
##                                                                                              t value
## (Intercept)                                                                                    6.744
## pct_gdp                                                                                        3.280
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature        0.784
## govt_type_shortconstitutional monarchy with executive head\nsharing power                      0.266
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                    -1.445
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                       0.526
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party   0.425
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party   -0.406
## govt_type_shortrepublic with executive head\nelected by legislature                            0.351
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature    -0.837
## govt_type_shortrepublic with executive head\nindependent of legislature                       -0.879
##                                                                                              Pr(>|t|)
## (Intercept)                                                                                  2.22e-10
## pct_gdp                                                                                       0.00126
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature       0.43383
## govt_type_shortconstitutional monarchy with executive head\nsharing power                     0.79072
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                    0.15034
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                      0.59946
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party  0.67151
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party   0.68556
## govt_type_shortrepublic with executive head\nelected by legislature                           0.72621
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature    0.40356
## govt_type_shortrepublic with executive head\nindependent of legislature                       0.38051
##                                                                                                 
## (Intercept)                                                                                  ***
## pct_gdp                                                                                      ** 
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature         
## govt_type_shortconstitutional monarchy with executive head\nsharing power                       
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                      
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                        
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party    
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party     
## govt_type_shortrepublic with executive head\nelected by legislature                             
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature      
## govt_type_shortrepublic with executive head\nindependent of legislature                         
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 19.15 on 173 degrees of freedom
##   (40 observations deleted due to missingness)
## Multiple R-squared:  0.2177, Adjusted R-squared:  0.1724 
## F-statistic: 4.813 on 10 and 173 DF,  p-value: 4.179e-06
# adj r-squared = 0.1724 (lower than pct_gdp alone)

# pct_gdp type + subregion + govt_type
lm_mult <- lm(lit_rate ~ pct_gdp + subregion + govt_type_short, data = j)
adjrsq <- c(adjrsq, summary(lm_mult)$adj.r.squared)
summary(lm_mult)
## 
## Call:
## lm(formula = lit_rate ~ pct_gdp + subregion + govt_type_short, 
##     data = j)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -43.598  -4.943   0.617   7.198  36.567 
## 
## Coefficients:
##                                                                                              Estimate
## (Intercept)                                                                                   85.3812
## pct_gdp                                                                                        2.2109
## subregionCentral Asia                                                                          7.0531
## subregionEastern Asia                                                                          5.6933
## subregionEastern Europe                                                                        6.0869
## subregionLatin America and the Caribbean                                                      -8.6144
## subregionMelanesia                                                                           -20.8966
## subregionMicronesia                                                                          -12.1172
## subregionNorthern Africa                                                                     -20.4318
## subregionNorthern America                                                                      1.3391
## subregionNorthern Europe                                                                       1.3766
## subregionPolynesia                                                                             5.4398
## subregionSouth-eastern Asia                                                                   -7.6281
## subregionSouthern Asia                                                                       -30.0771
## subregionSouthern Europe                                                                       2.5136
## subregionSub-Saharan Africa                                                                  -32.2298
## subregionWestern Asia                                                                         -2.9167
## subregionWestern Europe                                                                        4.7279
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature        1.7908
## govt_type_shortconstitutional monarchy with executive head\nsharing power                     -3.7303
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                   -14.2561
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                      -0.8975
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party -10.0148
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party   -2.7066
## govt_type_shortrepublic with executive head\nelected by legislature                            7.9204
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature    -5.5587
## govt_type_shortrepublic with executive head\nindependent of legislature                       -1.7359
##                                                                                              Std. Error
## (Intercept)                                                                                     13.4195
## pct_gdp                                                                                          0.7332
## subregionCentral Asia                                                                           12.2477
## subregionEastern Asia                                                                           13.0671
## subregionEastern Europe                                                                         11.4471
## subregionLatin America and the Caribbean                                                        10.5685
## subregionMelanesia                                                                              12.3311
## subregionMicronesia                                                                             15.1447
## subregionNorthern Africa                                                                        12.3039
## subregionNorthern America                                                                       14.1805
## subregionNorthern Europe                                                                        11.1278
## subregionPolynesia                                                                              14.7098
## subregionSouth-eastern Asia                                                                     11.2216
## subregionSouthern Asia                                                                          11.5356
## subregionSouthern Europe                                                                        11.2066
## subregionSub-Saharan Africa                                                                     10.7116
## subregionWestern Asia                                                                           11.1476
## subregionWestern Europe                                                                         11.3141
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature          8.0030
## govt_type_shortconstitutional monarchy with executive head\nsharing power                        8.7914
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                       9.8615
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                         7.7742
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party    17.9961
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party     10.2177
## govt_type_shortrepublic with executive head\nelected by legislature                             10.0152
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature       7.7796
## govt_type_shortrepublic with executive head\nindependent of legislature                          7.6871
##                                                                                              t value
## (Intercept)                                                                                    6.362
## pct_gdp                                                                                        3.015
## subregionCentral Asia                                                                          0.576
## subregionEastern Asia                                                                          0.436
## subregionEastern Europe                                                                        0.532
## subregionLatin America and the Caribbean                                                      -0.815
## subregionMelanesia                                                                            -1.695
## subregionMicronesia                                                                           -0.800
## subregionNorthern Africa                                                                      -1.661
## subregionNorthern America                                                                      0.094
## subregionNorthern Europe                                                                       0.124
## subregionPolynesia                                                                             0.370
## subregionSouth-eastern Asia                                                                   -0.680
## subregionSouthern Asia                                                                        -2.607
## subregionSouthern Europe                                                                       0.224
## subregionSub-Saharan Africa                                                                   -3.009
## subregionWestern Asia                                                                         -0.262
## subregionWestern Europe                                                                        0.418
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature        0.224
## govt_type_shortconstitutional monarchy with executive head\nsharing power                     -0.424
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                    -1.446
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                      -0.115
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party  -0.556
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party   -0.265
## govt_type_shortrepublic with executive head\nelected by legislature                            0.791
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature    -0.715
## govt_type_shortrepublic with executive head\nindependent of legislature                       -0.226
##                                                                                              Pr(>|t|)
## (Intercept)                                                                                  2.07e-09
## pct_gdp                                                                                       0.00300
## subregionCentral Asia                                                                         0.56552
## subregionEastern Asia                                                                         0.66366
## subregionEastern Europe                                                                       0.59566
## subregionLatin America and the Caribbean                                                      0.41625
## subregionMelanesia                                                                            0.09213
## subregionMicronesia                                                                           0.42487
## subregionNorthern Africa                                                                      0.09879
## subregionNorthern America                                                                     0.92489
## subregionNorthern Europe                                                                      0.90171
## subregionPolynesia                                                                            0.71203
## subregionSouth-eastern Asia                                                                   0.49765
## subregionSouthern Asia                                                                        0.01001
## subregionSouthern Europe                                                                      0.82282
## subregionSub-Saharan Africa                                                                   0.00306
## subregionWestern Asia                                                                         0.79394
## subregionWestern Europe                                                                       0.67661
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature       0.82323
## govt_type_shortconstitutional monarchy with executive head\nsharing power                     0.67192
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                    0.15027
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                      0.90824
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party  0.57866
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party   0.79144
## govt_type_shortrepublic with executive head\nelected by legislature                           0.43023
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature    0.47596
## govt_type_shortrepublic with executive head\nindependent of legislature                       0.82164
##                                                                                                 
## (Intercept)                                                                                  ***
## pct_gdp                                                                                      ** 
## subregionCentral Asia                                                                           
## subregionEastern Asia                                                                           
## subregionEastern Europe                                                                         
## subregionLatin America and the Caribbean                                                        
## subregionMelanesia                                                                           .  
## subregionMicronesia                                                                             
## subregionNorthern Africa                                                                     .  
## subregionNorthern America                                                                       
## subregionNorthern Europe                                                                        
## subregionPolynesia                                                                              
## subregionSouth-eastern Asia                                                                     
## subregionSouthern Asia                                                                       *  
## subregionSouthern Europe                                                                        
## subregionSub-Saharan Africa                                                                  ** 
## subregionWestern Asia                                                                           
## subregionWestern Europe                                                                         
## govt_type_shortconstitutional monarchy with ceremonial head\naccountable to legislature         
## govt_type_shortconstitutional monarchy with executive head\nsharing power                       
## govt_type_shortprovisional with no head\nwith no contsitutional legitimacy                      
## govt_type_shortrepublic with ceremonial head\naccountable to legislature                        
## govt_type_shortrepublic with ceremonial head\nconstitutionally granted power by single party    
## govt_type_shortrepublic with executive head\nconstitutionally granted power by single party     
## govt_type_shortrepublic with executive head\nelected by legislature                             
## govt_type_shortrepublic with executive head\nindependent of and accountable to legislature      
## govt_type_shortrepublic with executive head\nindependent of legislature                         
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 14.05 on 157 degrees of freedom
##   (40 observations deleted due to missingness)
## Multiple R-squared:  0.6179, Adjusted R-squared:  0.5546 
## F-statistic: 9.765 on 26 and 157 DF,  p-value: < 2.2e-16
# adj r-squared = 0.5546 (lower than pct_gdp and subregion)

# data frame
df_models <- data.frame(adj_rsquared = adjrsq, pct_gdp = incl_pct_gdp, 
    subregion = incl_subregion, govt_type = incl_govt_type)
df_models %>%
    kable(caption = "<i><font color=#000000><b>Table 5.</b> Linear model results</font></i>") %>% 
    kable_styling(bootstrap_options = c("striped", "hover", "condensed"), font_size = 13)
Table 5. Linear model results
adj_rsquared pct_gdp subregion govt_type
0.0774153 include
0.5086218 include
0.1334152 include
0.5616186 include include
0.1724391 include include
0.5546388 include include include
# Best model:
lm_mult <- lm(lit_rate ~ pct_gdp + subregion, data = j)
summary(lm_mult)
## 
## Call:
## lm(formula = lit_rate ~ pct_gdp + subregion, data = j)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -48.675  -3.745   1.107   7.960  37.623 
## 
## Coefficients:
##                                          Estimate Std. Error t value Pr(>|t|)
## (Intercept)                               85.7399    10.4087   8.237 4.17e-14
## pct_gdp                                    2.4785     0.6754   3.670 0.000323
## subregionCentral Asia                      3.2480    11.5778   0.281 0.779399
## subregionEastern Asia                      0.5249    11.3536   0.046 0.963178
## subregionEastern Europe                    1.6350    10.7033   0.153 0.878771
## subregionLatin America and the Caribbean  -9.9564    10.0655  -0.989 0.323966
## subregionMelanesia                       -22.3053    11.9564  -1.866 0.063797
## subregionMicronesia                      -11.9280    14.0872  -0.847 0.398316
## subregionNorthern Africa                 -30.1010    11.2929  -2.665 0.008416
## subregionNorthern America                  1.6622    12.6132   0.132 0.895308
## subregionNorthern Europe                  -0.8357    10.6984  -0.078 0.937825
## subregionPolynesia                         1.5042    13.8114   0.109 0.913402
## subregionSouth-eastern Asia              -11.1689    10.6730  -1.046 0.296810
## subregionSouthern Asia                   -33.3619    10.8698  -3.069 0.002492
## subregionSouthern Europe                   1.0278    10.5937   0.097 0.922821
## subregionSub-Saharan Africa              -35.9655    10.0097  -3.593 0.000426
## subregionWestern Asia                     -7.5503    10.3518  -0.729 0.466760
## subregionWestern Europe                    3.0897    10.8222   0.285 0.775604
##                                             
## (Intercept)                              ***
## pct_gdp                                  ***
## subregionCentral Asia                       
## subregionEastern Asia                       
## subregionEastern Europe                     
## subregionLatin America and the Caribbean    
## subregionMelanesia                       .  
## subregionMicronesia                         
## subregionNorthern Africa                 ** 
## subregionNorthern America                   
## subregionNorthern Europe                    
## subregionPolynesia                          
## subregionSouth-eastern Asia                 
## subregionSouthern Asia                   ** 
## subregionSouthern Europe                    
## subregionSub-Saharan Africa              ***
## subregionWestern Asia                       
## subregionWestern Europe                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.8 on 173 degrees of freedom
##   (33 observations deleted due to missingness)
## Multiple R-squared:  0.6008, Adjusted R-squared:  0.5616 
## F-statistic: 15.32 on 17 and 173 DF,  p-value: < 2.2e-16

Using forward selection, the best model is from using educational spending by itself, without subregion or government type as additional predictors.

Part 5 - Conclusion

Based on the results of this analysis, literacy rate is confirmed to be impacted positively by educational spending. It is noted that the impact is fairly steep, with every percentage point of GDP spent on education having a three-percent rise in literacy rate.

The results of the ANOVA analysis indicate strongly that there is a statistically significant difference between both literacy rate and educational spending among regions and, additionally, among various government types. Not surprisingly, higher literacy rates are enjoyed by republics having an elected head of state who is accountable to his or her constituents, while lower literacy rates were observed in countries with provisional governments. While it was expected that literacy rates in sub-Saharan Africa would be among the lowest, it was somewhat surprising that Central Asia boasted the highest overall literacy rates. These countries include the former Soviet republics of Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Uzbekistan. And while their overall literacy rate is, indeed, very high, according to the UN’s definition of literacy, many people in these countries are “functionally” illiterate.\(^5\) (UNESCO defines literacy as “the ability to use reading, writing and numeracy skills for effective functioning and development of the individual and the community. A person is literate who can, with understanding, both read and write a short statement on his or her everyday life.”\(^6\) Conversely, “a person is functionally literate who can engage in all those activities in which literacy is required for effective functioning of his group and community and also for enabling him to continue to use reading, writing, and calculation for his own and the community’s development.”\(^7\)) Another interesting outlier is the amount of money spent on education by Micronesia. While its average 7.9% of GDP spent on education, it should be noted that the U.S. funds around 90% of that amount in exchange for access to the islands for military purposes.\(^8\)

As noted above, not all conditions for ANOVA were met: Literacy rate data were significantly left-skewed, and the variance was not constant. Similarly, not all conditions for fitting a linear model were met: The residuals were skewed to the left, and variability narrowed at higher values.

In conclusion, there was significant statistical evidence to suggest literacy rate is also affected by subregion of the world and by the type of government in place. Perhaps more significantly, there was strong correlation between government spending on education (as a percentage of GDP) and literacy rate, with a three-fold increase in literacy for every percentage point increase in education spending.